home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 272_01 / smlibdl.doc < prev    next >
Text File  |  1987-08-15  |  27KB  |  991 lines

  1.          
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.                             ==========================
  15.                             =    STEVE'S LIBRARY     =
  16.                             =      for Datalight     =
  17.                             =        - by -          =
  18.                             =   Steven E. Margison   =
  19.                             ==========================
  20.  
  21.  
  22.                 Functions and Documentation Copyright 1986 & 1987
  23.                    by Steven E. Margison -- All Rights Reserved
  24.  
  25.  
  26.                                 ISBN 0-944267-06-8
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.          
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.          
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.                       --------- TABLE OF CONTENTS ---------
  75.  
  76.  
  77.               Introduction ................................. 1
  78.               The Documentation ............................ 1
  79.               Installation ................................. 2
  80.               Linking ...................................... 3
  81.               Interrupt Handler Functions .................. 4
  82.               Utilities ..... .............................. 5
  83.               On Buffering STDOUT .......................... 10
  84.               Shareware .................................... 11
  85.               Warranty ..................................... 12
  86.               Registration Form ............................ --
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.          
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.          
  134.  
  135.  
  136.  
  137.  
  138.                      Steve's Function Library for Datalight C
  139.  
  140.  
  141.          I. INTRODUCTION
  142.                  The heart  of  the  C  language  is  its  library.  Each
  143.          compiler has its own library of  functions,  which  is  complete
  144.          only  to  the degree that the compiler author wishes to make it.
  145.          The Datalight C Compiler  is  an  excellent  product  which  has
  146.          gotten  rave reviews in computer magazines. (I have both Lattice
  147.          3.1 and Datalight available to me and I prefer the Datalight  by
  148.          far.)  The  greatest criticism which can be leveled at Datalight
  149.          is the size of  its  library.    It  has  all  the  usual  basic
  150.          functions, plus some nice unique features.  But it still can use
  151.          some help.   Enter  Steve's  Library!   At over 100 functions my
  152.          library greatly enhances program development with Datalight C.
  153.  
  154.  
  155.  
  156.  
  157.          II. THE DOCUMENTATION
  158.                  The documentation for the  library  is  contained  in  a
  159.          number of .DOC  files,  which  describe  each  function.    When
  160.          printed, these pages may be  placed  in  a  standard  three-ring
  161.          binder.  A utility program, PMAN.COM is provided to generate the
  162.          entire set  of documents.  PMAN requires the file LISTALL, which
  163.          may be edited to eliminate printing of certain files if desired.
  164.          (PMAN is copyrighted, but placed in the public domain.)
  165.                  To print the DOC files, you must be in a  directory  (or
  166.          on  a  floppy)  containing PMAN, LISTALL, and all the DOC files.
  167.          Just type "PMAN" at your system prompt and  the  files  will  be
  168.          printed to PRN:.
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.                   Steve's C Library for Datalight         Page 1         
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.          
  200.  
  201.  
  202.          III. INSTALLATION
  203.  
  204.          Steve's Library is distributed as four library  files  for  each
  205.          type  of  memory  model. (Only the full registration with source
  206.          has all four libraries.) The filenames are:
  207.               SMDLS.LIB       Small Memory Model
  208.               SMDLD.LIB       Large Data Model
  209.               SMDLP.LIB       Large Code Model
  210.               SMDLL.LIB       Large Code and Data Model
  211.          For the remainder of this manual the libraries will be  referred
  212.          to as SMDLx.LIB.
  213.          A  typical hard disk installation of Datalight will consist of a
  214.          directory named  \DC  in  which  will  be  found  the  compiler,
  215.          Datalight libraries,  and  Datalight  header  files.   SMDLx.LIB
  216.          should be copied into this directory as well, or  into  whatever
  217.          directory the Datalight libraries have been installed.
  218.          Steve's  Library  also  includes several header files which list
  219.          "define"s for many useful items.  These header  files  are  also
  220.          required to re-compile the source for the libraries.  The header
  221.          files  should  be  copied into the \DC directory, or in whatever
  222.          other directory contains stdio.h, dos.h, and  the  other  header
  223.          files.   If you have purchased the source files and wish to have
  224.          them on hard disk, make a new subdirectory under  the  \DC  main
  225.          directory called SM (C:\DC\SM) and copy all source files to that
  226.          directory.
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.                   Steve's C Library for Datalight         Page 2         
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.          
  266.  
  267.  
  268.          IV. LINKING
  269.                  The SMDLx.LIB library must  be  linked  with  any  other
  270.          libraries whenever  a  function  is  used in your program.  Some
  271.          programs may not use  SMDLx.LIB  functions,  and  therefore  the
  272.          linking of  the  library  may  be  eliminated to save time.  The
  273.          Datalight driver (DLC) command line would look like this:
  274.                  DLC MYPROGRAM \DC\SMDLS.LIB
  275.          Naturally, if your directory  structure  is  not  the  standard,
  276.          specify the  paths  as  needed.   In addition, if you have other
  277.          third party libraries, be sure to include them after SMDLx.LIB.
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.                   Steve's C Library for Datalight         Page 3         
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.          
  332.  
  333.  
  334.          V. INTERRUPT HANDLER FUNCTIONS
  335.                  A  special  feature  of  Steve's  Library is the various
  336.          interrupt handler functions.  These are:
  337.                ticker
  338.                ctlbrk
  339.                criterr
  340.          These functions provide  the  programmer  with  the  ability  to
  341.          install   a   special  routine  to  intercept  one  of  the  DOS
  342.          interrupts. ctlbrk()  installs  a  user-defined  routine  to  be
  343.          executed  whenever  a  control-break  is  typed on the keyboard.
  344.          criterr() traps the DOS critical error  handler  (the  one  that
  345.          says Abort, Retry, etc.) and allows the programmer to substitute
  346.          his  own  handler.  ticker()  is  not  really  a  user definable
  347.          handler, but a  pre-built  handler  which  allows  the  user  to
  348.          perform operations  relative  to  the system's clock.  A special
  349.          variable  may  be  loaded  with  a  value  and  then  tested  at
  350.          intervals.  When the variable has hit zero, a specific amount of
  351.          time has passed.  The variable counts 18.2 times per second, and
  352.          is installed on INT 1CH.
  353.          The  usage  of  these interrupt handlers is slightly complex and
  354.          interactive.  For example, if you  use  ticker()  you  must  use
  355.          ctlbrk() and  you  may  have to use criterr().  It has been said
  356.          that a picture is worth a thousand words.  Well, to me, a source
  357.          file is worth a whole chapter of tutorial.  Therefore, refer  to
  358.          TESTINTS.C,  which is supplied with all distributions of Steve's
  359.          Library , to see a heavily commented source code file which uses
  360.          these interrupts.  This program may be compiled and run to watch
  361.          the result.
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.                   Steve's C Library for Datalight         Page 4         
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.          
  398.  
  399.  
  400.          VI. THE UTILITIES
  401.                  Beginning with Release 1.20 of my library, I am shipping
  402.          the source  code  for several utiltiies I have written.  Nothing
  403.          earth shaking here, just some convenient programs to make life a
  404.          little easier.  All the  programs  use  several  functions